home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / libdi.d / libdi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  4.7 KB  |  164 lines

  1. /*
  2.  *   libdi - CD Audio Player Device Interface Library
  3.  *
  4.  *   Copyright (C) 1995  Ti Kan
  5.  *   E-mail: ti@amb.org
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  */
  22. #ifndef __LIBDI_H__
  23. #define __LIBDI_H__
  24.  
  25. #ifndef LINT
  26. static char *_libdi_h_ident_ = "@(#)libdi.h    5.8 95/01/27";
  27. #endif
  28.  
  29. /* Max number of libdi modules */
  30. #define MAX_METHODS    2
  31.  
  32. /*
  33.  * Supported libdi methods
  34.  *
  35.  * Uncomment any of these to remove support for a method.
  36.  * Removing unused methods can reduce the executable
  37.  * binary size and run-time memory usage.  At least one
  38.  * method must be defined.
  39.  *
  40.  * Note: If compiling for DEMO_ONLY or on a non-supported OS
  41.  * platform, DI_SCSIPT must be defined.
  42.  */
  43. #define DI_SCSIPT    0    /* SCSI pass-through method */
  44. #if defined(linux) || defined(sun)
  45. #define DI_SLIOC    1    /* SunOS/Linux ioctl method */
  46. #endif
  47.  
  48.  
  49. /* Play audio format codes */
  50. #define ADDR_BLK        0x01    /* block address specified */
  51. #define ADDR_MSF        0x02    /* MSF address specified */
  52. #define ADDR_TRKIDX        0x04    /* track/index numbers specified */
  53. #define ADDR_OPTEND        0x80    /* End address can be ignored */
  54.  
  55.  
  56. /* Slider control flags */
  57. #define WARP_VOL        0x1             /* Set volume slider thumb */
  58. #define WARP_BAL        0x2             /* Set balance slider thumb */
  59.  
  60.  
  61. /* Misc constants */
  62. #define MAX_SRCH_BLKS        225    /* max search play blks per sample */
  63. #define MAX_RECOVERR        20    /* Max number of err recovery tries */
  64. #define ERR_SKIPBLKS        10    /* Number of frame to skip on error */
  65. #define ERR_CLRTHRESH        1500    /* If there hasn't been any errors
  66.                      * for this many blocks of audio
  67.                      * playback, then the previous errors
  68.                      * count is cleared.
  69.                      */
  70.  
  71.  
  72. /* CD position MSF structure */
  73. typedef struct msf {
  74.     byte_t        res;        /* reserved */
  75.     byte_t        min;        /* minutes */
  76.     byte_t        sec;        /* seconds */
  77.     byte_t        frame;        /* frame */
  78. } msf_t;
  79.  
  80.  
  81. /* Combined MSF and logical address union */
  82. typedef union lmsf {
  83.     msf_t        msf;        /* MSF address */
  84.     word32_t    logical;    /* logical address */
  85. } lmsf_t;
  86.  
  87.  
  88. /*
  89.  * Jump table structure for libdi interface
  90.  */
  91. typedef struct {
  92.     bool_t    (*check_disc)(curstat_t *);
  93.     void    (*status_upd)(curstat_t *);
  94.     void    (*lock)(curstat_t *, bool_t);
  95.     void    (*repeat)(curstat_t *, bool_t);
  96.     void    (*shuffle)(curstat_t *, bool_t);
  97.     void    (*load_eject)(curstat_t *);
  98.     void    (*ab)(curstat_t *);
  99.     void    (*sample)(curstat_t *);
  100.     void    (*level)(curstat_t *, byte_t, bool_t);
  101.     void    (*play_pause)(curstat_t *);
  102.     void    (*stop)(curstat_t *, bool_t);
  103.     void    (*prevtrk)(curstat_t *);
  104.     void    (*nexttrk)(curstat_t *);
  105.     void    (*previdx)(curstat_t *);
  106.     void    (*nextidx)(curstat_t *);
  107.     void    (*rew)(curstat_t *, bool_t);
  108.     void    (*ff)(curstat_t *, bool_t);
  109.     void    (*warp)(curstat_t *);
  110.     void    (*route)(curstat_t *);
  111.     void    (*mute_on)(curstat_t *);
  112.     void    (*mute_off)(curstat_t *);
  113.     void    (*start)(curstat_t *);
  114.     void    (*icon)(curstat_t *, bool_t);
  115.     void    (*halt)(curstat_t *);
  116.     char *    (*mode)(void);
  117.     char *    (*vers)(void);
  118. } di_tbl_t;
  119.  
  120.  
  121. /*
  122.  * Jump table for libdi initialization
  123.  */
  124. typedef struct {
  125.     void    (*init)(curstat_t *, di_tbl_t *);
  126. } diinit_tbl_t;
  127.  
  128.  
  129. /*
  130.  * Public function prototypes: libdi external calling interface.
  131.  */
  132. extern void    di_init(curstat_t *);
  133. extern bool_t    di_check_disc(curstat_t *);
  134. extern void    di_status_upd(curstat_t *);
  135. extern void    di_lock(curstat_t *, bool_t);
  136. extern void    di_repeat(curstat_t *, bool_t);
  137. extern void    di_shuffle(curstat_t *, bool_t);
  138. extern void    di_load_eject(curstat_t *);
  139. extern void    di_ab(curstat_t *);
  140. extern void    di_sample(curstat_t *);
  141. extern void    di_level(curstat_t *, byte_t, bool_t);
  142. extern void    di_play_pause(curstat_t *);
  143. extern void    di_stop(curstat_t *, bool_t);
  144. extern void    di_prevtrk(curstat_t *);
  145. extern void    di_nexttrk(curstat_t *);
  146. extern void    di_previdx(curstat_t *);
  147. extern void    di_nextidx(curstat_t *);
  148. extern void    di_rew(curstat_t *, bool_t);
  149. extern void    di_ff(curstat_t *, bool_t);
  150. extern void    di_warp(curstat_t *);
  151. extern void    di_route(curstat_t *);
  152. extern void    di_mute_on(curstat_t *);
  153. extern void    di_mute_off(curstat_t *);
  154. extern void    di_start(curstat_t *);
  155. extern void    di_icon(curstat_t *, bool_t);
  156. extern void    di_halt(curstat_t *);
  157. extern char    *di_mode(void);
  158. extern char    *di_vers(void);
  159. extern bool_t    di_isdemo(void);
  160.  
  161.  
  162. #endif    /* __LIBDI_H__ */
  163.  
  164.